package cn.xuewei.controller;


import cn.xuewei.mapper.VideoMapper;
import cn.xuewei.pojo.vo.VideoIndexVO;
import cn.xuewei.response.ResultVO;
import cn.xuewei.response.StatusCode;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/v1/videos/")
public class VideoController {
    @Autowired(required = false)
    private VideoMapper videoMapper;

    @RequestMapping("/{bvid}")
    public ResultVO select(@PathVariable String bvid){
      //  List<VideoIndexVO> list = videoMapper.select("1Tq4y1J7SC");
        return ResultVO.ok(videoMapper.select(bvid));
    }
}
